package com.testMvc.cust;

import com.alibaba.fastjson.JSONObject;
import com.core.jdbc.MySqlSession;
import com.core.netty.http.work.HttpMyReponse;
import com.core.netty.http.work.HttpMyRequest;
import com.core.springmvc.MyController;
import com.core.springmvc.MyRequestMapping;

import java.util.HashMap;
import java.util.Map;

@MyController
@MyRequestMapping("/CustAction")
public class CustAction {

    @MyRequestMapping("/getCustList")
    public void getCustList(HttpMyRequest req, HttpMyReponse rep)  {
        CustDao cd = MySqlSession.getMapper(CustDao.class);
        Map<String, Object> par = new HashMap<>();
        par.put("name", "%杜%");
        Map<String, Object> result = new HashMap<>();
        result.put("data", cd.getCustList(par));
        rep.fullWrite(JSONObject.toJSONString(result));

    }
}
